package com.xiong.wuliao;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

public class MoreActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageButton myMoreButtonGoodBack;// 返回按钮
    private ImageView myMoreSwitchImageView; // 是否接收推送消息
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_more);
        init();
    }

    private void init() {
        initView();
        setListener();
    }

    private void setListener() {
        myMoreButtonGoodBack.setOnClickListener(this);
        myMoreSwitchImageView.setOnClickListener(this);
    }

    private void initView() {
        myMoreButtonGoodBack = (ImageButton) findViewById(R.id.myMoreButtonGoodBack);
        myMoreSwitchImageView = (ImageView) findViewById(R.id.myMoreSwitchImageView);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.myMoreButtonGoodBack:
                MoreActivity.this.finish();
                break;
            case R.id.myMoreSwitchImageView:
                myMoreSwitchImageView.setImageResource(R.mipmap.switch_bar);
                break;
        }
    }
}
